<template>
    <cluedetail
            :readonly="true"
            ref="cluedetail"
            :hideBtn="false"
            @tabclick="tabclick"
    >
        <form-btns ref="btns" slot="btns" @close="cancle" @transfer="submit"/>
    </cluedetail>
</template>
<script>
    import { mapActions, mapGetters, mapState } from "vuex";
    import FormBtns from "@/views/comps/zhzf/form-btns";
    import cluedetail from "@/views/evidence/detail/casedetail";
    export default {
        data() {
            return {
                detail: {
                    newTabItem:'',
                },
                tabindex:''
            };
        },
        components: {
            cluedetail,
            FormBtns
        },
        mounted(){
            let detail = this.$route.params.row;
            this.initPage(detail);
        },
        methods: {
            ...mapActions("d2admin/page", ["close"]),
            cancle(){
                this.close({ tagName: "/evidence/register/detail" });
            },
            submit(){
                this.$refs.cluedetail.submitData()
            },
            async initPage(detail){
                this.$refs.cluedetail.initPage(detail);
                this.$refs.btns.setBtns([
                    {url: 'close', name: '取消', icon: 'fa fa-close', type: 'danger'},
                    {url: 'transfer', name: '暂存', icon: 'fa fa-close', type: 'primary'},
                ])
            },
            tabclick(tab){
                this.tabindex = tab.index;
            }
        }
    };
</script>
<style lang="scss">
    .case-detail {
        background: #fff;
        padding-bottom: 20px;
        border: 1px solid #ccc;
        .el-form {
            .el-form-item__label {
                width: 120px !important;
            }
            .el-form-item__content {
                margin-left: 120px !important;
            }
            .el-date-editor.el-input {
                width: 100% !important;
            }
        }
    }
</style>
